package com.whub507.msgmanager.security.controller;

import com.whub507.msgmanager.common.ResResult;
import com.whub507.msgmanager.security.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@CrossOrigin
@RequestMapping("/user")
@Api(value = "注销接口")
public class LogoutController {
    @Resource
    UserService userService;

    @ApiOperation("注销")
    @GetMapping("/logout")
    public ResResult<Boolean> logout(String userName) {
        userService.logout(userName);
        return ResResult.ok(Boolean.TRUE, "注销成功");
    }
}
